use zen_expression::isolate::Isolate;

fn main() {
    let isolate = Isolate::new();
    
    // 测试用例1: 有交集的数字数组
    let result1 = isolate.run("hasIntersection([1, 2, 3], [3, 4, 5])").unwrap();
    println!("hasIntersection([1, 2, 3], [3, 4, 5]) = {}", result1);
    assert_eq!(result1.as_bool().unwrap(), true);
    
    // 测试用例2: 没有交集的数字数组
    let result2 = isolate.run("hasIntersection([1, 2, 3], [4, 5, 6])").unwrap();
    println!("hasIntersection([1, 2, 3], [4, 5, 6]) = {}", result2);
    assert_eq!(result2.as_bool().unwrap(), false);
    
    // 测试用例3: 有交集的字符串数组
    let result3 = isolate.run("hasIntersection(['a', 'b', 'c'], ['c', 'd', 'e'])").unwrap();
    println!("hasIntersection(['a', 'b', 'c'], ['c', 'd', 'e']) = {}", result3);
    assert_eq!(result3.as_bool().unwrap(), true);
    
    // 测试用例4: 没有交集的字符串数组
    let result4 = isolate.run("hasIntersection(['a', 'b', 'c'], ['d', 'e', 'f'])").unwrap();
    println!("hasIntersection(['a', 'b', 'c'], ['d', 'e', 'f']) = {}", result4);
    assert_eq!(result4.as_bool().unwrap(), false);
    
    // 测试用例5: 混合类型数组（有交集）
    let result5 = isolate.run("hasIntersection([1, 'hello', true], [true, 'world', 2])").unwrap();
    println!("hasIntersection([1, 'hello', true], [true, 'world', 2]) = {}", result5);
    assert_eq!(result5.as_bool().unwrap(), true);
    
    // 测试用例6: 包含 null 的数组
    let result6 = isolate.run("hasIntersection([1, null, 3], [null, 4, 5])").unwrap();
    println!("hasIntersection([1, null, 3], [null, 4, 5]) = {}", result6);
    assert_eq!(result6.as_bool().unwrap(), true);
    
    // 测试用例7: 空数组
    let result7 = isolate.run("hasIntersection([], [1, 2, 3])").unwrap();
    println!("hasIntersection([], [1, 2, 3]) = {}", result7);
    assert_eq!(result7.as_bool().unwrap(), false);
    
    println!("所有测试用例通过！");
} 